package com.hysf.controller;

import com.hysf.entity.Good;
import com.hysf.service.CategoryService;
import com.hysf.service.GoodService;
import com.hysf.service.impl.CategoryServiceImpl;
import com.hysf.service.impl.GoodServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public class GoodController extends Base{
    GoodService service =new GoodServiceImpl();
    GoodService service2 =new GoodServiceImpl();
    GoodService service3 =new GoodServiceImpl();
    GoodService service4 =new GoodServiceImpl();
    /**
     *
     * @Description:
     *
     * @Author: 石涛
     * @Date: 2024/4/9 10:51
     **/

    protected void find1(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Good> goods = service.HEfind();
        req.setAttribute("goods", goods);
        List<Good> goods2 = service2.Bookfind();
        req.setAttribute("goods2", goods2);
        List<Good> goods3 = service3.Phonefind();
        req.setAttribute("goods3", goods3);
        List<Good> goods4 = service4.DGfind();
        req.setAttribute("goods4", goods4);

        CategoryService service = new CategoryServiceImpl();

        //req.getSession().setAttribute("goods",goods);
        req.getRequestDispatcher("/index.jsp").forward(req,resp);
    }
}
